﻿using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.Runtime.InteropServices;
using System.ComponentModel.Design;
using Microsoft.Win32;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.SharePoint;
using EnvDTE;
using EnvDTE80;

namespace SPVSX.Common
{
    public class StatusBarLogger
    {
        private static StatusBarLogger singleton = null;
        
        private DTE dte = null;

        public static StatusBarLogger Instance
        {
            get
            {
                if (singleton == null)
                {
                    throw new Exception("Logger has not been initialized!");
                }
                return singleton;
            }
        }

        public static void InitializeInstance(DTE dte)
        {
            singleton = new StatusBarLogger(dte);
        }

        private StatusBarLogger(DTE dte)
        {
            this.dte = dte;
        }

        public void SetStatus(string message)
        {
            this.dte.StatusBar.Text = message;
        }
    }
}
